package genericity2;

import genericity1.Student;

public class GenericDemo4 {
    public static void main(String[] args) {
        //目标：学会定义泛型方法，及作用
        //需求：打印任意数组的内容
        String[] names = {"Song","Tom","Alice","Bob","anny","王八","bili"};
        printArray(names);

        Student[] stus = new Student[5];
        printArray(stus);

        //避免泛型方法中的类型推导问题
        Student max = getMax(stus);//返回学生
        String max1 = getMax(names);//返回字符串
    }

    public static <T> void  printArray(T[] names){

    }
    public static <T> T getMax(T[] names){
        return null;
    }
}
